/**
 * 
 */
package com.thor.palmmall.rest.vkcommunicate.converter;

import org.springframework.core.convert.converter.Converter;

import com.thor.palmmall.rest.vkcommunicate.AVKCommunicateDetail;
import com.thor.palmmall.spi.vkcommunicate.SVKCommunicateDetail;

/**
 * @author Captain
 *
 * @since 1.0
 */
public class AVKCommunicateDetailConverter
    implements Converter<SVKCommunicateDetail, AVKCommunicateDetail> {

  public static AVKCommunicateDetailConverter getInstance() {
    if (instance == null)
      instance = new AVKCommunicateDetailConverter();
    return instance;
  }

  private static AVKCommunicateDetailConverter instance;

  private AVKCommunicateDetailConverter() {
  }

  @Override
  public AVKCommunicateDetail convert(SVKCommunicateDetail source) {
    if (source == null) {
      return null;
    }
    AVKCommunicateDetail target = new AVKCommunicateDetail();
    target.setNumber(source.getNumber());
    target.setCommunicateDate(source.getCommunicateDate());
    target.setContent(source.getContent());
    return target;
  }

}
